Repository navigation
fix(plugin-detail): a related list that already shows 0 keeps showing 0 while it reloads - #37220
Conversation
…rough a refetch Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 · area a4-U · 2026-11-25T04:59Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…ad forgets it Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for the delta read (rework round 1) · area a4-U · 2026-11-25T07:18Z Against REWORK 7153451306:
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…etch Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
…st's count Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for the delta read (rework round 2) · area a4-U · 2026-11-25T11:56Z Against L1 7156146414:
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing · area a4-U · 2026-11-25T12:06Z · head
The seat's optional nits are carried, not pushed:
State change: ready for review, and auto-merge is armed. The queue lands it. On MERGED, #36822 closes through |
Fixes #36822
Clause-②: no
Metadata-protocol: none
维护者速读
Responsibility
@object-ui/plugin-detailRelatedList.countPending.What changes
ui/packages/plugin-detail/src/RelatedList.tsx:countPendingnow also requires!countKnown.countKnownis set to true only where a read the list actually issued resolves (the record-payload seeded read, thedataSource.findread, the raw-URL read), and set back to false where one of those reads rejects, because the rejection empties the rows and 0 is not their count. A path that reads nothing never sets it: the no-scope early return (parent still loading,parentIdnull), a refused filter, the no-adapter refusals. The paths among those that empty the rows without reading (the no-scope return and both no-adapter refusals) also set it back to false, so an earlier count does not survive them. Result:describefor 相关列表:重新加载后结果为 0 条时,数量角标会短暂消失,而不是显示 0 #36822 in the existing badge harnessui/packages/plugin-detail/src/__tests__/RelatedList.countPending-36235.test.tsx.patchchangeset for@object-ui/plugin-detail.Files to read first
ui/packages/plugin-detail/src/RelatedList.tsx, thecountKnown/countPendinghunk: the only behaviour change.#36822describe in the test file: the held in-flight frame assertions (refetch, Retry, first scoped read, read after a scope loss).Two-minute check
cd ui && pnpm exec vitest run packages/plugin-detail/src/__tests__/RelatedList.countPending-36235.test.tsx— expect 8 passed.Tests
a list that answered 0 keeps drawing 0 through a refetch that answers no rows: holds the refetch in flight and asserts the badge reads0on that held frame; that assertion carries the pin. A MutationObserver also samples the badge across the refetch and finds no reading other than0. It is a secondary signal only: it samples when its callback runs, not on each commit, so two commits inside one task would be coalesced.a list that answered rows draws their count through a refetch, then the 0 it answers:2during the held refetch, then0, nothing else in between.a read that fails after rows were known draws no count while Retry reads, never a false 0: answers 2 rows, makes the refetch reject, clicks Retry, holds Retry's read and asserts no badge, then0once it answers no rows.a list with no scope on its first render draws no count during its first real read: renders withparentIdnull (no read is sent), rerenders with the parent id, holds that first read and asserts no badge, then2.a list whose parent reloads through no scope draws no count during the new parent's read:ACC-1answers 2 rows (badge2), thenparentIdnull (no read), thenACC-2with its read held: no badge on that frame, then1.Readings (head 8bfd2f7, origin/main merged at 83585e7)
Test Files 1 passed (1),Tests 8 passed (8).cd ui && pnpm exec vitest run packages/plugin-detail/):Test Files 418 passed | 1 skipped (419),Tests 3951 passed | 18 skipped (3969), exit 0.pnpm --filter @object-ui/plugin-detail run type-check: exit 0 (the test file is in thetsconfig.test.jsonprogram).scripts/ablation-replace.mjs. Each mutation landed (anchor 1 to 0) and was restored to blob == HEAD withgit diff HEADempty.1426a1d54928:!countKnowndropped fromcountPending. The 0-refetch pin fails on the held frame (expected null to be '0').setCountKnown(false)removed from thefindrejection. The Retry pin fails (expected '0' to be null).setCountKnown(true)added to the no-scope early return. The first-scoped-read pin fails (expected '0' to be null).1 failed | 6 passed (7).c6a0a1451618:setCountKnown(false)removed from the no-scope early return. The scope-loss pin fails (expected '0' to be null),1 failed | 7 passed (8).expected null to be '0'),1 failed | 7 passed (8).Acceptance notes
countKnownis not reset when the parent or the list's filter changes directly, from one scope to the next: such a list keeps drawing its last count during the new read, as it already did when its last answer had rows. A parent that reloads through no scope (parentIdnull while the parent record loads) empties the rows without reading and forgets the count, so the new parent's read draws nothing.loadingis false and the badge draws0. That is the same onmain(read from the code, not measured in a browser). This PR only makes sure that phase does not mark the count known, so the first real read draws nothing.RelatedListin jsdom with a deferredfind.Verification
node scripts/pm/dispatch-gates.mjs --commandsfor this diff are run locally; CI-only families (type-check lanes, whole-tree families) are left to the PR's check-runs.Generated by Claude Code